import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

// 1、一级路由  首页 登录
// 2、二级路由 在首页下  数据看板和文章管理
const routes = [
  {
    path: '/login',
    component: () => import('@/views/login')
  },
  {
    path: '/',
    component: () => import('@/views/layout'),
    redirect: 'dashboard',
    children: [

      {
        path: 'dashboard',
        component: () => import('@/views/dashboard')
      },
      {
        path: 'article',
        component: () => import('@/views/article')
      }
    ]
  }

]

const router = new VueRouter({

  routes
})

export default router
